var app = getApp()
Page({
  data: {
  
  },
  onLoad: function (e) {
    var that = this;
    that.requestVip();
  },
  onShow: function () {
    app.setNavtitle('会员权益');
  },
  requestVip:function(){
    var that = this;
    wx.showLoading({
      title: '加载中',
      mask: true,
      time: 100000
    })
    wx.request({
      url: app.globalData.requestUrl,
      data: {
        map: 'applet_member_member_level'
      },
      success: function (res) {
        console.log(res.data);
        if (res.data.ec == 200) {
         that.setData({
           vipinfo: res.data.data
         })
        } else {
          console.log(res.data)
          app.errorTip(that, res.data.em, 2000);
        }
      },
      complete: function () {
        wx.hideLoading();
      }
    });
  },
  //打开折扣卡
  openBuyMenberCard: function () {
    var that = this;
    wx.navigateTo({
      url: '/subpages/buyMenberCard/buyMenberCard',
    })
  },
})